/*
 Navicat Premium Data Transfer

 Source Server         : mysql
 Source Server Type    : MySQL
 Source Server Version : 50711
 Source Host           : localhost
 Source Database       : shiro-demo

 Target Server Type    : MySQL
 Target Server Version : 50711
 File Encoding         : utf-8

 Date: 03/25/2019 01:06:37 AM
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `sys_menu`
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '菜单编号',
  `parent_id` int(10) DEFAULT '0' COMMENT '父级编号',
  `name` varchar(100) DEFAULT NULL COMMENT '菜单名称',
  `sort` int(10) DEFAULT '1' COMMENT '菜单排序',
  `href` varchar(200) DEFAULT NULL COMMENT '链接地址',
  `target` varchar(100) DEFAULT NULL COMMENT '链接目标',
  `icon` varchar(100) DEFAULT NULL COMMENT '图标',
  `permission` varchar(200) DEFAULT NULL COMMENT '权限标识',
  `del_flag` smallint(1) DEFAULT '0' COMMENT '是否显示(0未删除,1删除)',
  `remarks` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `sys_menu`
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` VALUES ('1', '0', '商品管理', '1', '/goods', null, null, 'sys:good:list', '0', null), ('2', '1', '商品添加', '1', null, null, null, 'sys:good:create', '0', null), ('3', '1', '商品修改', '1', null, null, null, 'sys:good:update', '0', null), ('4', '1', '商品删除', '1', null, null, null, 'sys:good:delete', '0', null), ('5', '0', '新闻管理', '1', '/news', null, null, 'sys:news:list', '0', null), ('6', '5', '新闻增加', '1', null, null, null, 'sys:news:create', '0', null), ('7', '5', '新闻修改', '1', null, null, null, 'sys:news:update', '0', null), ('8', '5', '新闻删除', '1', null, null, null, 'sys:news:delete', '0', null);
COMMIT;

-- ----------------------------
--  Table structure for `sys_role`
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '角色编号',
  `name` varchar(20) DEFAULT NULL COMMENT '角色名称',
  `ename` varchar(20) DEFAULT NULL COMMENT '角色英文名称',
  `del_flag` smallint(1) DEFAULT '0' COMMENT '是否删除(0未删除,1删除)',
  `remarks` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `sys_role`
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES ('1', '系统管理员', 'sys_admin', '0', null), ('2', '管理员', 'admin', '0', null), ('3', '商品管理员', 'good_admin', '0', null), ('4', '新闻管理员', 'news_admin', '0', null);
COMMIT;

-- ----------------------------
--  Table structure for `sys_role_menu`
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `role_id` int(10) DEFAULT NULL COMMENT '角色编号',
  `menu_id` int(10) DEFAULT NULL COMMENT '菜单编号',
  PRIMARY KEY (`id`),
  KEY `role_id` (`role_id`),
  KEY `menu_id` (`menu_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `sys_role_menu`
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` VALUES ('1', '1', '1'), ('2', '1', '2'), ('3', '1', '3'), ('4', '1', '4'), ('5', '1', '5'), ('6', '1', '6'), ('7', '1', '7'), ('8', '1', '8'), ('9', '2', '1'), ('10', '2', '2'), ('11', '2', '3'), ('12', '2', '4'), ('13', '2', '5'), ('14', '2', '6'), ('15', '2', '7'), ('16', '2', '8'), ('17', '3', '1'), ('18', '3', '2'), ('19', '3', '3'), ('20', '3', '4'), ('21', '4', '5'), ('22', '4', '6'), ('23', '4', '7'), ('24', '4', '8');
COMMIT;

-- ----------------------------
--  Table structure for `sys_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `user_id` int(10) DEFAULT NULL COMMENT '用户编号',
  `role_id` int(10) DEFAULT NULL COMMENT '角色编号',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `role_id` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `sys_user_role`
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` VALUES ('1', '1', '1'), ('2', '2', '2'), ('3', '3', '4'), ('4', '4', '4'), ('5', '5', '1');
COMMIT;

-- ----------------------------
--  Table structure for `sys_users`
-- ----------------------------
DROP TABLE IF EXISTS `sys_users`;
CREATE TABLE `sys_users` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '用户编号',
  `account` varchar(20) DEFAULT NULL COMMENT '账号',
  `password` varchar(100) DEFAULT NULL COMMENT '密码',
  `nickname` varchar(10) DEFAULT NULL COMMENT '昵称',
  `login_ip` varchar(20) DEFAULT NULL COMMENT '登录ip',
  `login_date` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '最后登录时间',
  `del_flag` smallint(1) DEFAULT '0' COMMENT '是否删除(0未删除,1删除)',
  `role_id` int(10) DEFAULT NULL COMMENT '角色编号',
  `remarks` varchar(255) DEFAULT NULL COMMENT '备注',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `sys_users`
-- ----------------------------
BEGIN;
INSERT INTO `sys_users` VALUES ('1', 'chenliang', '0975ea952bb388067bfd68a5370c70c5', '隔壁老陈', '127.0.0.1', '2019-03-24 13:17:04', '0', '1', '系统管理员'), ('2', 'zhaoqiong', '0975ea952bb388067bfd68a5370c70c5', '小琼子', '127.0.0.1', '2019-03-24 13:18:33', '0', '2', '管理员'), ('3', 'zhangsan', '0975ea952bb388067bfd68a5370c70c5', '张三', '127.0.0.1', '2019-03-24 13:19:50', '0', '4', '新闻管理员'), ('4', 'lisi', '0975ea952bb388067bfd68a5370c70c5', '李四', '127.0.0.1', '2019-03-24 13:20:09', '0', '4', '商品管理员'), ('5', 'boss', '0975ea952bb388067bfd68a5370c70c5', '大老板', '127.0.0.1', '2019-03-24 13:21:05', '0', '1', '大老板');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
